package MyRunnnable.way2;

public class Test {
    public static void main(String[] args) {
        Thread myThread =new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i <10 ; i++) {

                    System.out.println(Thread.currentThread().getName()+"->"+i);
                }
            }
        });
        myThread.start();
        Thread myThread2 =new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i <10 ; i++) {

                    System.out.println(Thread.currentThread().getName()+"->"+i);
                }
            }
        });
        myThread2.start();
    }
}
